package com.ssyx.order.controller;

import com.ssyx.model.order.OrderInfo;
import com.ssyx.order.service.OrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * ClassName:OrderInnerController
 * Description:
 *
 * @Author kay
 * @Create 2024/5/24 19:43
 * @Version 1.0
 */
@RestController
@RequestMapping(value="/api/order")
public class OrderInnerController {

    @Autowired
    private OrderInfoService orderInfoService;

    //根据orderNo,查询订单相关信息
    @GetMapping("inner/getOrderInfoByOrderNo/{orderNo}")
    public OrderInfo getOrderInfoByOrderNo(@PathVariable String orderNo){
        OrderInfo orderInfo = orderInfoService.getOrderInfoByOrderNo(orderNo);
        return orderInfo;
    }

    //修改订单信息表状态,已支付后的状态
    @PostMapping("inner/orderPay/{orderNo}")
    public Boolean orderPay(@PathVariable String orderNo){
        orderInfoService.orderPay(orderNo);
        return true;
    }
}
